<!-- toaster directive -->
<toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
<!-- / toaster directive -->

<!-- 导航条 -->
<div class="bg-white bread-crumb">
    <ul class="breadcrumb b-a m-b-n-xs lter b-b wrapper-md">
        <li><a ui-sref="main.tpl.homePage"><i class="fa fa-home"></i> 首页</a></li>
        <li class="active" ng-bind="title"></li>
    </ul>
</div>

<!-- 加载提醒 -->
<div ng-show="loading" class="text-center m-t-md text-lg"><i class="fa fa-spin fa-spinner"></i> 数据加载中...</div>

<!-- 内容区域 -->
<div ng-hide="loading" class="wrapper-md content">
    <!-- 数据显示 -->
    <div class="wrapper-data">
        <div class="panel panel-default">
            <!-- 头部 -->
            <div class="panel-body">
				<form ng-submit="searchRe()" class="form-horizontal">
                   	<div class="form-group center">
                   		<div class="col-sm-2">
                           	<input type="text" class="form-control" placeholder="请输入广告主ID" ng-model="param.id" onkeyup="if(!/^[0-9]+$/.test(this.value)) { this.value='';}" id="id">
                       	</div>
                   	
                   		<div class="col-sm-2">
                           	<input type="text" class="form-control" placeholder="请输入企业名称" ng-model="param.companyName">
                       	</div>
                       	
                   		<div class="col-sm-2">
                   			<input type="text" class="form-control" placeholder="请输入联系人" ng-model="param.personName">
                       	</div>
                       	
                   		<div class="col-sm-2">
                           	<input type="text" class="form-control" placeholder="请输入联系方式" ng-model="param.mobile">
                       	</div>
                        <div class="col-sm-2">
                            <select class="form-control" ng-model="param.status">
                                <option value="">--全部状态--</option>
                                <option value="1">待审核</option>
                                <option value="2">启用中/审核成功</option>
                                <option value="3">审核失败</option>
                                <option value="4">停用中</option>
                                <option value="5">取消/删除</option>
                            </select>
                        </div>
                        <!--<div class="col-md-2">-->
                            <!--<input type="text" id="regTime" placeholder="请选择申请时间" class="form-control" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>-->
                        <!--</div>-->
                        <div class="col-sm-2">
                            <input type="text" class="form-control" placeholder="请输入行业类型" ng-model="param.companyType">
                        </div>
                   	</div>
                   	
                   	<div class="form-group">

                       	
                   		<!--<div class="col-md-2">-->
                           	<!--<input type="text" id="approveTime" placeholder="请选择审核时间" class="form-control" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>-->
                       	<!--</div>-->

                        <div class="col-sm-2">
                            <input type="text" id="regStartTime" placeholder="请选择申请开始时间" class="form-control" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
                        </div>
                        <div class="col-sm-2">
                            <input type="text" id="regEndTime" placeholder="请选择申请结束时间" class="form-control" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
                        </div>

                        <div class="col-sm-2">
                            <input type="text" id="approveStartTime" placeholder="请选择审核开始时间" class="form-control" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
                        </div>

                        <div class="col-sm-2">
                            <input type="text" id="approveEndTime" placeholder="请选择审核结束时间" class="form-control" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
                        </div>
                        <div class="col-sm-4">
                            <label class="col-sm-3 control-label"><button class="ifc-btn btn-primary" type="submit">查询</button></label>
                            <label class="col-sm-3 control-label"><button class="ifc-btn btn-success" type="button" ng-click="approve('',2)" >批量通过</button></label>
                            <label class="col-sm-3 control-label"><button class="ifc-btn btn-danger" type="button" ng-click="refuseAdverts('',3)" >批量失败</button></label>
                            <label class="col-sm-3 control-label"><button class="ifc-btn  btn-info" type="button" ng-click="copySuppy()" >开通流量主</button></label>
                    </div>
                    </div>
				</form>
            </div>

            <!-- 数据表格 -->
            <div class="table-responsive">
                <table class="table table-striped b-t b-light text-center">
                    <thead>
                    <tr>
                    	<th><input type="checkbox" ng-click="selectAll($event)"/>全选</th>
                        <th>编号</th>
                        <th>广告主ID</th>
                        <th>企业名称</th>
                        <th>主页链接</th>
                        <th>联系人</th>
                        <th>投放渠道</th>
                    <!--   <th>用户来源</th>-->
                        <th>行业标签</th>
                        <!--<th>营业执照</th>-->
                        <th>申请时间</th>
                        <th>审核时间</th>
                        <th>状态</th>
                        <th>平台审核</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="item in pageInfo.records">
                    	<td class="v-middle">
                            <input type="checkbox" name="selected" ng-checked="isSelected(item.id)" ng-click="updateSelection($event,item)"/></td>
                        <td class="v-middle">{{$index + 1}}</td>
                        <td class="v-middle">{{item.id}}</td>
                        <td class="v-middle" title="{{item.companyName}}">{{item.companyName | limitTo:10}}</td>
                        <td class="v-middle"><a target="_blank" href="{{item.webSite}}" class="text-info" title="{{item.webSite}}">{{item.webSite | limitTo:30}}</a></td>
                        <td class="v-middle">{{item.personName}}</td>
                        <td class="v-middle">
                            <span ng-if="item.utmSource==1">蜂巢SSP</span>
                            <span ng-if="item.utmSource==2">蜂巢云投</span>
                        </td>
                       <!--<td class="v-middle">
                            <span ng-if="item.utmSource==1">蜂巢</span>
                            <span ng-if="item.utmSource==2">智子云</span>
                        </td>-->
                        <td class="v-middle" title="{{item.companyType}}">{{item.companyType | limitTo:10}}</td>
                        <!--<td class="v-middle"><a ng-click="preview(item.businessLicense)" class="text-info" >查看</a></td>-->
                        <!--<td class="v-middle"><img src="{{url}}{{item.businessLicense}}" ng-click="preview(item.businessLicense)" style="width: 50px;height: 40px;"/> </td>-->
                        <td class="v-middle">{{item.regTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                        
                        <td class="v-middle">
                            <span ng-if="item.approveTime==null || item.approveTime==''">-</span>
                            <span ng-if="item.approveTime!=null && item.approveTime!=''">{{item.approveTime | date:'yyyy-MM-dd HH:mm:ss'}}</span>
                        </td>
                        
                        <td class="v-middle">
                            <span ng-if="item.status==1" class="text-danger">待审核</span>
                            <span ng-if="item.status==2" class="text-success">已通过</span>
                            <span ng-if="item.status==3">已拒绝</span>
                            <span ng-if="item.status==4">停用中</span>
                            <span ng-if="item.status==5">取消</span>
                        </td>

                        <td class="v-middle"><button class="btn btn-success" ng-click="selectmodal(item.zzyAdvertiseId)" ng-if="item.status!=1 && item.utmSource==2 ">查看</button></td>

                        <td class="v-middle">
                        	<a ui-sref="main.user.userAdverts.detail({id: item.id})" class="btn btn-sm btn-default">
                                <i class="fa fa-edit m-r-xs text-sm"></i>详情</a>
                        
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div><!-- /.table-responsive -->

            <div class="cover" ng-show="firstApply">
                <div class="firstApplyWrap noselect">
                    <div class="clear"><i class="iconfont closeBtn noselect" ng-click="firstApply=false">&#xe608;</i></div>
                    <div class="title">
	           			<span ng-repeat="item in businessLicenses track by $index">
	           				<a target='_blank' href='{{item}}'><img alt='' height='100' width='100' src='{{item}}'></a>
	           			</span>
                    </div>
                </div>
            </div>

            <!-- 底部分页 -->
			<span data-ng-include=" 'src/tpl/pageInfo.html' "></span>
        </div><!-- /.panel -->
    </div><!-- /.wrapper-data -->

</div><!-- /.wrapper-md -->

<form id="saveUserAdverts">
    <div class="modal fade bs-example-modal-lg" tabindex="-1" data-backdrop="static" id="refuseUserAdverts" role="dialog" aria-labelledby="gridSystemModalLabelAdverts">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="gridSystemModalLabelAdverts">广告主审核</h4>
                </div>
                <div class="modal-body">
                    <p></p>
                    <div class="row">
                        <label class="col-sm-2 control-label text-right">拒绝原因:</label>
                        <div class="col-sm-4">
                            <textarea  placeholder="请输入审核失败的原因......" class="form-control" rows="5" id="approveReason"></textarea>
                        </div>
                    </div>
                    <p></p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary" ng-click="saveUserAdverts(3)">确定</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->
    <!--<div class="cover" ng-show="firstApply1">-->
        <!--<div class="firstApplyWrap">-->
            <!--<div class="clear"><i class="iconfont closeBtn noselect" ng-click="firstApply1=false">&#xe608;</i></div>-->
            <!--<div class="title" >-->
                <!--<div class="modal-header">-->
                    <!--&lt;!&ndash;<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>&ndash;&gt;-->
                    <!--<h4 class="modal-title" id="CashLabel1">广告主审核</h4>-->
                <!--</div>-->
                <!--<div class="modal-body">-->
                    <!--<div class="row">-->
                        <!--<label class="col-sm-4 control-label text-right">广告投放权限:</label>-->
                        <!--<div class="col-sm-4">-->
                            <!--<select class="form-control require" name="utmSource" id="utmSource">-->
                                <!--<option value="1">联璧蜂巢</option>-->
                                <!--<option value="2">智子云</option>-->
                            <!--</select>-->
                        <!--</div>-->
                    <!--</div>-->
                <!--</div>-->
                <!--<div class="modal-footer">-->
                    <!--<button type="button" class="btn btn-default" ng-click="firstApply1=false" data-dismiss="modal">取消</button>-->
                    <!--<button type="button" class="btn btn-primary" ng-click="approves(2)" id="btn">确定</button>-->
                <!--</div>-->
            <!--</div>-->

        <!--</div>-->
    <!--</div>-->

</form>

<div class="cover" ng-show="selectPlatform" >
    <div class="firstApplyWrap1" style="overflow-y:scroll">
        <div class="clear"><i style="float: right; margin-top: 5px; margin-right: 5px; cursor: pointer; color:#ccc; font-size: 30px;" class=" iconfont closeBtn noselect" ng-click="selectPlatform=false">&#xe608;</i></div>
        <div class="title" >
            <div class="modal-header">
                <h4 class="modal-title" id="CashLabel">平台审核</h4>
            </div>
            <div class="modal-body">

            <!-- 数据表格 -->
            <div class="table-responsive">
                <table class="table table-striped b-t b-light text-center">
                    <thead>
                    <tr>
                        <th>平台名称</th>
                        <th>渠道</th>
                        <th>审核状态</th>
                        <th>审核说明</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="item in platforms">
                        <td class="v-middle" title="{{item.platformName}}">{{item.platformName | limitTo:10}}</td>
                        <td class="v-middle">
                            <span>智子云</span>
                        </td>
                        <td class="v-middle">
                            <span ng-if="item.state==0" class="text-danger">未提交</span>
                            <span ng-if="item.state==1" style="color: #00E8D7">审核中</span>
                            <span ng-if="item.state==2" class="text-success">审核通过</span>
                            <span ng-if="item.state==3" style="color: #564aa3">审核失败</span>
                        </td>
                        <td class="v-middle" title="{{item.verifyMessage}}">{{item.verifyMessage | limitTo:10}}</td>
                    </tr>
                    </tbody>
                </table>
            </div><!-- /.table-responsive -->

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" ng-click="selectPlatform=false" data-dismiss="modal">取消</button>
                <!--<button type="button" class="btn btn-primary" ng-click="approve(record.id,2)">确定</button>-->
            </div>
        </div>
    </div>
</div>

<style>
    .cover {
        position: fixed;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 2000;
        top: 0;
        left: 0;
        /* display: none; */
    }

    .firstApplyWrap{
        width: 550px;
        height:280px;
        background: #fff;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%,-50%);
        -webkit-transform: translate(-50%,-50%);
        -ms-transform: translate(-50%,-50%);
        -o-transform: translate(-50%,-50%);
        -moz-transform: translate(-50%,-50%);
        border-radius: 5px;
        overflow: hidden;
    }
    .firstApplyWrap1{
        width: 950px;
        height:680px;
        background: #fff;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%,-50%);
        -webkit-transform: translate(-50%,-50%);
        -ms-transform: translate(-50%,-50%);
        -o-transform: translate(-50%,-50%);
        -moz-transform: translate(-50%,-50%);
        border-radius: 5px;
        overflow: hidden;
    }
    .firstApplyWrap .title{
        font-size: 18px;
        color:#333;
        padding:18px 36px 0 36px;
        text-align: center;
        line-height: 2em;
    }
    .firstApplyWrap .closeBtn,.finishData .closeBtn{
        font-size: 30px;
        padding:5px 10px 0 0;
        border-radius: 50%;
        color: #ccc;
        float: right;
        cursor: pointer;
    }
    .finishData .closeBtn{
        position: absolute;
        top:10px;
        right:10px;
    }
    .firstApplyWrap .bkgIcon{
        position: absolute;
        left: 54px;
        top:87px;
        font-size: 50px;
        color:#FFB136;
    }
    .firstApplyWrap .applyBtnWrap{
        position: absolute;
        bottom: -2px;
        width: 100%;
    }
    .firstApplyWrap .applyBtn{
        width: 50%;
        height:70px;
        line-height: 70px;
        background: #FFB135;
        font-size: 20px;
        text-align: center;
        color:#fff;
        cursor: pointer;
        float:left;
    }
    .firstApplyWrap .applyBtn:last-child{
        background: #5796FC;
    }





</style>